//
//  BorderButton.m
//  MoneyIndividual
//
//  Created by Le Anh Tai on 1/11/14.
//  Copyright (c) 2014 Le Anh Tai. All rights reserved.
//

#import "BorderButton.h"

@implementation BorderButton

- (id)initWithTitle:(NSString *)title
{
    self = [super init];
    
    if (self)
    {
        [self setTitle:title forState:UIControlStateNormal];
        
        self.titleLabel.font = FONT(FONT_SIZE_NORMAL);
        
        [self setTitleColor:COLOR_WHITE_PURE forState:UIControlStateNormal];
        [self setTitleColor:COLOR_BLUE_DARK forState:UIControlStateHighlighted];
        
        [self setBackgroundColor:[UIColor clearColor]];
        
        self.layer.borderColor = COLOR_WHITE_PURE.CGColor;
        self.layer.borderWidth = 1;
        self.layer.cornerRadius = 3;
    }
    
    return self;
}

- (void)setHighlighted:(BOOL)highlighted
{
    [super setHighlighted:highlighted];
    
    if (highlighted)
    {
        self.layer.borderColor = COLOR_BLUE_DARK.CGColor;
    }
    else
    {
        self.layer.borderColor = COLOR_WHITE_PURE.CGColor;
    }
}
@end
